<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class module extends CI_Controller {
	
	public function index(){}
	
    public function get_bill()
	{            
            $status = "";
            $tcode = $this->input->post('tcode');
			$track_ref = $this->input->post('track_ref');

            $qry = "SELECT * FROM tbl_tracks where ".$track_ref."='".$tcode."' order by id DESC"; 
            $query = $this->db->query($qry);
            $bill = $query->result_array();
            if(count($bill)>0){
                $bill = $bill[0];
                $qry1 = "SELECT * FROM tbl_status where bill_number='".$bill['bill_number']."' order by id DESC";
                $query1 = $this->db->query($qry1);
                $status = $query1->result_array();                
            }
            
			$bdata = array('bill'=>$bill,'status'=>$status);
            $data['bill_data'] = $bdata;
            $this->load->view('homepageview',$data);	
	}
}

